<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			// function selectArr(arr){
			// var newArr = [];
			// 			var j = 0;
			// 			for (var i = 0; i < arr.length; i++) {
			// 			  if (arr[i] >= 10) {
			// 			    //newArr[j++] = arr[i];    // 新数组索引号从0开始，依次递增
			// 				newArr.push(arr[i]);
			// 			  }
			// 			}
			// 			return arr;
			// 			}
			// 			console.log(selectArr([2, 0, 6, 1, 77, 0, 52, 0, 25, 7]));       // 输出结果：(3) [77, 52, 25]
var arr = [1, 4, 3, 2, 5, 5];
			//筛选等于3的元素
			console.log(selectArr(arr, "=", 3));
			//筛选大于等于3的元素
			console.log(selectArr(arr, ">=", 3));
			//筛选大于三的元素
			console.log(selectArr(arr, ">", 3));
			//筛选小于等于3的元素
			console.log(selectArr(arr, "<=", 3));
			//筛选小于3的元素
			console.log(selectArr(arr, "<", 3));

		</script>
	</head>
	<body>
	</body>
</html>
